#ifndef JOYSYICK_GAMEPAD_H_INCLUDED
#define JOYSYICK_GAMEPAD_H_INCLUDED

#include<stdio.h>
#include<stdlib.h>
#include<conio.h>

#include<Windows.h>

//添加joystick操作api的支持库
#include<MMSystem.h>
#pragma comment(lib, "Winmm.lib")

struct JOYINFO_OUTPUT
{
	double dwSize;                /* size of structure */
	double dwFlags;               /* flags to indicate what to return */
	int dwXpos;                /* x position */
	int dwYpos;                /* y position */
	int dwZpos;                /* z position */
	double dwRpos;                /* rudder/4th axis position */
	double dwUpos;                /* 5th axis position */
	double dwVpos;                /* 6th axis position */
	int dwButtons;             /* button states */
	double dwButtonNumber;        /* current button number pressed */
	int dwPOV;                 /* point of view state */
	double dwReserved1;           /* reserved for communication between winmm & driver */
	double dwReserved2;           /* reserved for future expansion */
};

void JoystickInit(JOYINFOEX* joy);

bool getJoystick(JOYINFOEX* pji);

void trans(JOYINFOEX* pji, int type, double range_begin, double range_end);

int Joystick_OutPut(JOYINFOEX *pji, void* data, double dt);

#endif // TOOL_FUNCTION_H_INCLUDED
